class Person(object):
    personNum = 0
    @classmethod
    def howmanyPerson(cls):
        print('there are {} people in the world'.format(cls.personNum))    
    def __init__(self,pnick,psex,page):
        Person.personNum = self.personNum + 1
        self.nick = pnick
        self.sex = psex
        self.age = page
    def intro(self):
        sexTuple =('male','female')
        print('I am  {} and  {} and  {} years old'.format(self.nick,sexTuple[self.sex],self.age))
    def __add__(self,pother):
        from random import randint
        tsex = randint(0,1)
        baby = Person('Noname',tsex,1)
        return baby
p1 = Person('jhon',0,18)
p1.intro()
p2 = Person('rose',1,18)
p2.intro()
baby = p1 + p2
baby.intro()

Person.howmanyPerson()  #与下一句相同
#p1.howmanyPerson()




    